//package com.southwind.controller;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.ResponseEntity;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//@RestController
//@RequestMapping("/api/customer")
//public class CustomerController {
//    @Autowired
//    private CustomerService customerService;
//
//    @PostMapping("/login")
//    public ResponseEntity<?> login(@RequestBody LoginRequest request) {
//        String code = request.getCode();
//        String openId = WechatUtil.getOpenId(code);
//
//        // 查询或注册客户
//        Customer customer = customerService.findOrCreateByOpenId(openId);
//
//        // 生成 JWT Token
//        String token = JwtUtil.generateToken(customer.getCustomerId());
//
//        return ResponseEntity.ok(new LoginResponse(token));
//    }
//}
